#!/usr/python3.11/bin/python3.11

import sys
args = sys.argv

def func1():
    print("this is func1")

def func2():
    print("this is func2")

class A:
    def __init__(self, func_name):
        self.name = func_name

    def __getitem__(self, key):
        func_name = getattr(self, key)
        if func_name == 'func1':
            func1()
        elif func_name == 'func2':
            func2()
        else:
            print("输入不合法")
        return f"传入的函数名是{self.name}"

# 取到传递的函数名
a = A(args[1])
print(a["name"])
